﻿@(
    Ajax.Dna().Widget().Content(@<text>
    <table style="width: 100%">
        @if (item.UserPreferences["Company"] != null)
        {
            if (!string.IsNullOrEmpty(item.UserPreferences["Company"].ToString()))
            { 
            <tr>
                <td style="white-space: nowrap; vertical-align: top;">
                    @Html.Global("RES_COMPANY"):
                </td>
                <td style="vertical-align: top;" colspan="2">
                    @item.UserPreferences["Company"]
                </td>
            </tr>
            }
        }
        @if (item.UserPreferences["Contact"] != null)
        {
            if (!string.IsNullOrEmpty(item.UserPreferences["Contact"].ToString()))
            { 
            <tr>
                <td style="white-space: nowrap; width: 20px; vertical-align: top;">
                    @Html.Global("RES_CONTACT") :
                </td>
                <td style="vertical-align: top;">
                    @item.UserPreferences["Contact"].ToString().Trim()
                </td>
            </tr>
            }
        }
        @if (item.UserPreferences["Phone"] != null)
        {
            if (!string.IsNullOrEmpty(item.UserPreferences["Phone"].ToString()))
            { 
            <tr>
                <td style="white-space: nowrap; vertical-align: top;">
                    @Html.Global("RES_PHONE"):
                </td>
                <td style="vertical-align: top;">
                    @item.UserPreferences["Phone"].ToString().Trim()
                </td>
            </tr>
            }
        }
        @if (item.UserPreferences["Mobile"] != null)
        {
            if (!string.IsNullOrEmpty(item.UserPreferences["Mobile"].ToString()))
            { 
            <tr>
                <td style="white-space: nowrap; vertical-align: top;">
                    @Html.Global("RES_MOBILE"):
                </td>
                <td style="vertical-align: top;">
                    @item.UserPreferences["Mobile"].ToString().Trim()
                </td>
            </tr>
            }
        }
        @if (item.UserPreferences["Fax"] != null)
        {
            if (!string.IsNullOrEmpty(item.UserPreferences["Fax"].ToString()))
            { 
            <tr>
                <td style="white-space: nowrap; vertical-align: top;">
                    @Html.Global("RES_FAX"):
                </td>
                <td valign="top">
                    @item.UserPreferences["Fax"].ToString().Trim()
                </td>
            </tr>
            }
        }
        @if (item.UserPreferences["Email"] != null)
        {
            if (!string.IsNullOrEmpty(item.UserPreferences["Email"].ToString()))
            { 
            <tr>
                <td style="white-space: nowrap; vertical-align: top;">
                    @Html.Global("RES_EMAIL"):
                </td>
                <td style="white-space: nowrap; vertical-align: top;">
                    <a href="mailto:@item.UserPreferences["Email"].ToString().Trim()" title="@item.UserPreferences["Email"].ToString().Trim()">
                        @item.UserPreferences["Email"].ToString().Trim()</a>
                </td>
            </tr>
            }
        }
        @if (item.UserPreferences["WebSite"] != null)
        {
            if (!string.IsNullOrEmpty(item.UserPreferences["WebSite"].ToString()))
            { 
            <tr>
                <td style="white-space: nowrap; vertical-align: top;">
                    @Html.Global("RES_WEBSITE"):
                </td>
                <td style="vertical-align: top;">
                    <a href='@item.UserPreferences["WebSite"].ToString().Trim()' target="_blank">
                        @item.UserPreferences["WebSite"].ToString().Trim()</a>
                </td>
            </tr>
            }
        }
        @if (item.UserPreferences["Address"] != null)
        {
            if (!string.IsNullOrEmpty(item.UserPreferences["Address"].ToString()))
            { 
            <tr>
                <td style="white-space: nowrap; vertical-align: top;">
                    @Html.Global("RES_ADDRESS"):
                </td>
                <td style="vertical-align: top;">
                    @item.UserPreferences["Address"].ToString().Trim()
                </td>
            </tr>
            }
        }
        @if (item.UserPreferences["PostCode"] != null)
        {
            if (!string.IsNullOrEmpty(item.UserPreferences["PostCode"].ToString()))
            { 
            <tr>
                <td style="white-space: nowrap; vertical-align: top;">
                    @Html.Global("RES_POSTCODE"):
                </td>
                <td style="vertical-align: top;">
                    @item.UserPreferences["PostCode"].ToString().Trim()
                </td>
            </tr>
            }
        }
    </table>
    </text>
        )
     .Preview(@<text>
    <table style="width: 100%">
        <tr>
            <td style="white-space: nowrap; vertical-align: top;">
                @Html.Global("RES_COMPANY"):
            </td>
            <td style="vertical-align: top;" colspan="2">
                Sample company inc.
            </td>
        </tr>
        <tr>
            <td style="white-space: nowrap; width: 20px; vertical-align: top;">
                @Html.Global("RES_CONTACT") :
            </td>
            <td style="vertical-align: top;">
                Json Tom
            </td>
        </tr>
        <tr>
            <td style="white-space: nowrap; vertical-align: top;">
                @Html.Global("RES_PHONE"):
            </td>
            <td style="vertical-align: top;">
                +01 888 888
            </td>
        </tr>
        <tr>
            <td style="white-space: nowrap; vertical-align: top;">
                @Html.Global("RES_MOBILE"):
            </td>
            <td style="vertical-align: top;">
                +01 888 888
            </td>
        </tr>
        <tr>
            <td style="white-space: nowrap; vertical-align: top;">
                @Html.Global("RES_FAX"):
            </td>
            <td style="vertical-align: top;">
                +01 888 888
            </td>
        </tr>
        <tr>
            <td style="white-space: nowrap; vertical-align: top;">
                @Html.Global("RES_EMAIL"):
            </td>
            <td style="vertical-align: top;">
                <a href="mailto:sample@dotnetage.com" title="sample@dotnetage.com">sample@dotnetage.com</a>
            </td>
        </tr>
        <tr>
            <td style="white-space: nowrap; vertical-align: top;">
                @Html.Global("RES_WEBSITE"):
            </td>
            <td style="vertical-align: top;">
                <a href="http://www.dotnetage.com" target="_blank">http://www.dotnetage.com</a>
            </td>
        </tr>
        <tr>
            <td style="white-space: nowrap; vertical-align: top;">
                @Html.Global("RES_ADDRESS"):
            </td>
            <td style="vertical-align: top;">
                XXX Amphitheate Parkway USA
            </td>
        </tr>
        <tr>
            <td style="white-space: nowrap; vertical-align: top;">
                @Html.Global("RES_POSTCODE"):
            </td>
            <td style="vertical-align: top;">
                CA
            </td>
        </tr>
    </table>
    </text>)
     .GetHtml()
)
